/*
 * TCSS 422 - Spring quarter 2011
 * Team: 	Googlers
 * Members: Deepa Sahni, Krisnil Gounder, Michael Schweiger
 * Date: 	April 7, 2011
 */
package testing;

import org.junit.Test;

import static org.junit.Assert.*;

import buffers.PageBuffer;

/**
 * A simple JUnit test for PageBuffer.  PageBuffer is not a very complicated object,
 * and most of the methods have already been tested (inherited from Buffer)
 * @author Michael Schweiger
 * @version 1.0
 */
public class PageBufferUnitTest {
	
	/**
	 * Tests to verify that the PageBuffer is a singleton.
	 */
	@Test
	public void testSingleton() {
		PageBuffer[] buffer_arr = new PageBuffer[100];
		buffer_arr[0] = PageBuffer.getInstance();
		for (int i = 1; i < 100; i++) {
			buffer_arr[i] = PageBuffer.getInstance();
			assertSame(buffer_arr[i - 1], buffer_arr[i]);
		}
	}
}
